package com.own.demo.constants;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

/**
 * 常量
 *
 * @author heguanglong
 * @date 2020-11-05 11:13:27
 */
public interface Constants {

    /**
     * 项目的版本号，所有url地址必须带
     */
    String VERSION = "v1";

    String VERSION_V2 = "v2";
    /**
     * 服务接口拦截器根地址
     */
    String SERVER_PATH_INTERCEPTOR = "/" + VERSION;
    String SERVER_PATH_INTERCEPTOR_V2 = "/" + VERSION_V2;

    /**
     * 項目总模块名称
     */
    String SERVER_MODEL_USER_TRACK = "/" + VERSION + "/track";

    String SERVER_MODEL_USER_TRACK_V2 = "/" + VERSION_V2 + "/track";

    String SERVER_MODEL_USER_TRACK_API = "/" + VERSION + "/track/api";

    /**
     * 用户模块前缀
     */
    String SERVER_MODEL_USER = "/" + SERVER_MODEL_USER_TRACK + "/user";

    /**
     * 设备模块前缀
     */
    String SERVER_MODEL_DEVICE = "/" + SERVER_MODEL_USER_TRACK + "/device";
    /**
     * 数据通道服务接口
     */
    String SERVER_MODEL_CHANNEL = SERVER_MODEL_USER_TRACK + "/channel";
    String SERVER_MODEL_CHANNEL_V2 = SERVER_MODEL_USER_TRACK_V2 + "/channel";

    /**
     * 历史轨迹模块
     */
    String SERVER_MODEL_HISTORY = SERVER_MODEL_USER_TRACK + "/history";
    String SERVER_MODEL_HISTORY_V2 = SERVER_MODEL_USER_TRACK_V2 + "/history";

    /**
     * 数据通道身份认证，不需要鉴权
     */
    String SERVER_MODEL_IDENT = SERVER_MODEL_CHANNEL + "/ident";


    /**
     * sdk请求接口前缀
     */
    String SERVER_MODEL_SDK = SERVER_MODEL_USER_TRACK + "/sdk";

    /**
     * 用户模块前缀
     */
    String SERVER_MODEL_SEARCH = SERVER_MODEL_USER_TRACK + "/search";

    /**
     * token标志
     */
    String TOKEN_SIGN = "accessToken";

    /**
     * 全中国区域编码
     */
    String ALL_CHINA_AREA_CODE = "100000";

    /**
     * 查询易图通每次返回的最大数量
     */
    int POI_MAP_SELECT_SIZE = 100;


    /**
     * 数据库可用为0
     */
    int DB_DELETED_0 = 0;

    /**
     * 数据库不可用1
     */
    int DB_DELETED_1 = 1;

    int ONE = 1;
    int TWO = 2;
    int THREE = 3;
    int FOUR = 4;
    int FIVE = 5;
    int ZERO = 0;
    int HASH_MAP_DEFAULT_SIZE = 64;
    int TWELVE = 12;
    int ELEVEN = 11;
    int FIFTEEN = 15;
    int TEN = 10;
    int TWO_THOUSAND = 2000;
    int DAY_MILLISECOND = 86400000;

    int DAY_NUM = 7;
    /**批量获取道路信息的数量*/
    int BATCH_PAGE_PLACE =60;
    int DAY_SECOND = 86400;
    String TIMEZONE = "GMT+8";

    String REQUEST_POST = "POST";
    String REQUEST_PUT = "PUT";
    String REQUEST_DELETE = "DELETE";
    String REQUEST_GET = "GET";

    int NEGATIVE_ONE = -1;

    int EIGHT = 8;

    /**
     * 可以为中文、大小写英文、支持的符号为英文减号”-”、英文下划线”_”及英文句号”.”，符号不能作为字段的开头 字符不能超过128个
     */
    String REGEX_VALUE = "^(?!-)[a-zA-Z-\u4E00-\u9FA5][a-zA-Z0-9-\u4E00-\u9FA5_.\\-]{0,128}$";

    /**
     * 可以为中文、大小写英文、支持的符号为英文减号”-”、英文下划线”_”及英文句号”.”，符号不能作为字段的开头 字符不能超过128个
     */
    String REGEX_VALUE_NUM = "^(?!-)[a-zA-Z-0-9\u4E00-\u9FA5][a-zA-Z0-9-\u4E00-\u9FA5_.\\-]{0,128}$";
    /**
     * 正则表达式
     */
    Pattern PATTERN_NAME = Pattern.compile(Constants.REGEX_VALUE);


    String TRUE_STR = "TRUE";
    String FALSE_STR = "FALSE";

    /**
     * 轨迹抽稀默认值
     */
    Double SIMPLIFY = 0.0001;

    /**
     * 轨迹绑路默认精度
     */
    Integer ACCURACY = 5;

    /**
     * 需要轨迹补偿距离
     */
    double DISTANCE_APART = 5000;

    /**
     * 易图通绑路支接口支持的最大数量
     */
    int EMAPGO_MATCH_MAX_GPS = 1000;

    /**
     * 道路对应的等级缓存
     * Map<String, RoadGradleInfo> ROAD_GRADLE_INFO_MAP = new HashMap<>(Constants.TWO_THOUSAND);
     */

    String COMMA = ",";

    String ROAD_DEFAULT_NAME = "本地路";

    int SCYLLA_DB_BATCH_SIZE = 500;

    String SORT_ASC = "ASC";

    String SORT_DESC = "DESC";

    int ES_DEFAULT_SIZE = 500;

    /**
     * 不可分割符号
     */
    String SEPARATOR = String.valueOf((char) 0x01);
    String ES_GREATER = ">";
    String ES_LESS = "<";
    String ES_EQUAL = "=";

    String ES_GREATER_EQUAL = ">=";
    String ES_LESS_EQUAL = "<=";


    String DOUBLE_LOWER = "d";
    String DOUBLE_UN_LOWER = "D";
    String CODE = "code";

    String REQ_DATA_ERROR="dataError";
    Map<Long, String> TRACK_V1_DATA_SERVER_ID = new HashMap<>(Constants.HASH_MAP_DEFAULT_SIZE);
}
